Skip to content

[Bugfix] Arduino detection for headers.#412

Merged
h2zero merged 1 commit intomasterfrom
bugfix/arduino-detect
Mar 25, 2026
Merged

[Bugfix] Arduino detection for headers.#412
h2zero merged 1 commit intomasterfrom
bugfix/arduino-detect

Conversation

@h2zero
Copy link
Copy Markdown
Owner

@h2zero h2zero commented Mar 25, 2026

Summary by CodeRabbit

  • Chores

    • Improved automatic detection of Arduino String support and adjusted conditional includes to better match build environments.
    • Minor internal cleanup to ensure consistent conditional compilation behavior.
  • Style

    • Reformatted and realigned code declarations and method layouts for improved readability and maintainability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 666af059-2b74-45c5-81e3-efc914f7d4c1

📥 Commits

Reviewing files that changed from the base of the PR and between 1133277 and b6fe954.

📒 Files selected for processing (2)
  • src/NimBLEAttValue.h
  • src/NimBLEStream.h
✅ Files skipped from review due to trivial changes (1)
  • src/NimBLEStream.h
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/NimBLEAttValue.h

📝 Walkthrough

Walkthrough

Arr: Add compile-time detection for Arduino String availability (via __has_include(<Arduino.h>)) and conditionally include Arduino string/stream headers; plus formatting/alignment tweaks in stream-related declarations across two headers. (≤50 words)

Changes

Cohort / File(s) Summary
Arduino String Feature Detection
src/NimBLEAttValue.h, src/NimBLEStream.h
Introduce NIMBLE_CPP_ARDUINO_STRING_AVAILABLE when not defined using __has_include(<Arduino.h>); conditionally include Arduino headers (<WString.h> / <Stream.h>) and gate Arduino String constructors/operators behind that macro.
Formatting & Alignment
src/NimBLEStream.h
Whitespace and alignment normalization for member declarations and public method signatures; minor assignment formatting tweak in setRxOverflowCallback. No API signature changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

Arr, the headers spy the Arduino bay,
A macro hoisted to chart the way.
Spacing trimmed, the code obeys,
Shipshape sails through build-time bays. ⚓️

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Arr, the title '[Bugfix] Arduino detection for headers' be clearly summarizin' the main change—improvin' Arduino header detection logic in the codebase, matey!

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/arduino-detect

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/NimBLEAttValue.h`:
- Around line 24-36: The macro NIMBLE_CPP_ARDUINO_STRING_AVAILABLE is currently
defined to 0/1 which makes later preprocessor checks like "#ifdef
NIMBLE_CPP_ARDUINO_STRING_AVAILABLE" evaluate true even when Arduino isn't
present; update the conditionals to use "#if
NIMBLE_CPP_ARDUINO_STRING_AVAILABLE" wherever the code currently uses "#ifdef
NIMBLE_CPP_ARDUINO_STRING_AVAILABLE" (e.g., the blocks that include Arduino APIs
and the String-related APIs) so the sections are compiled only when the macro is
true, or alternatively change the initial detection to only `#define`
NIMBLE_CPP_ARDUINO_STRING_AVAILABLE (1) when <Arduino.h> is found and leave it
undefined otherwise so existing "#ifdef" checks work as intended.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ef2cc8aa-a3f2-4293-b347-5b4c2c5f63bb

📥 Commits

Reviewing files that changed from the base of the PR and between 0dbca80 and 4889812.

📒 Files selected for processing (2)
  • src/NimBLEAttValue.h
  • src/NimBLEStream.h

@h2zero h2zero force-pushed the bugfix/arduino-detect branch from 4889812 to 1133277 Compare March 25, 2026 19:01
@h2zero h2zero force-pushed the bugfix/arduino-detect branch from 1133277 to b6fe954 Compare March 25, 2026 19:17
@h2zero h2zero merged commit 5d48f94 into master Mar 25, 2026
66 checks passed
@h2zero h2zero deleted the bugfix/arduino-detect branch March 25, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant